//
//  DropLoadingView.h
//  MVideo
//
//  Created by Lin Eidan on 13-12-6.
//  Copyright (c) 2013年 taomee. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
    DropNormal,   //正常
    DropReadyLoad, //准备去请求
    DropLoading,  //请求中
    DropLoadedSuccess  //请求成功
} DropState;

@protocol DropLoadingViewDelegate;

@interface DropLoadingView : UIView

@property (strong, nonatomic) IBOutlet UIView *customView;

@property (strong, nonatomic) UIScrollView *parentView;
@property (weak, nonatomic) id<DropLoadingViewDelegate>delegate;
@property (assign, nonatomic) DropState dropState;
@property(assign, nonatomic) float defaultFrameY;

@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *loadingActView;
@property (strong, nonatomic) IBOutlet UILabel *loadingLabel;
@property (strong, nonatomic) IBOutlet UIImageView *loadingImageView;

- (id)initWithParentView:(UIScrollView *)scrollView andDelegate:(id)delegate;

//scrollView滚动的时候调用
-(void)onScroll;

//scrllView停止拖动的时候调用
-(void)endDraing;

//获得数据成功
-(void)hasGetDataOverAndRestore;

-(void)hasCancelRequestAndRestore;

@end

@protocol DropLoadingViewDelegate <NSObject>

@optional
//开始转菊花了，告诉别人这个时候开始去请求数据，一般是重新请求第一页
-(void)dropLoadingViewStartGetData:(DropLoadingView *)dropLoadingView;


@end
